﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Client_Web.Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:LoginView ID="LoginView1" runat="server">
            <AnonymousTemplate>
                [ <a href="~/Account/Login.aspx" id="HeadLoginStatus" runat="server">Se connecter</a>
                ]
            </AnonymousTemplate>
            <LoggedInTemplate>
                Bienvenue <span class="bold">
                    <asp:LoginName ID="HeadLoginName" runat="server" />
                </span>! [
                <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Se déconnecter"
                    LogoutPageUrl="~/" />
                ]
            </LoggedInTemplate>
        </asp:LoginView>
        <asp:Login runat="server" EnableViewState="false" RenderOuterTable="false">
            <LayoutTemplate>
                <span class="failureNotification">
                    <asp:Literal ID="FailureText" runat="server"></asp:Literal>
                </span>
                <asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="failureNotification"
                    ValidationGroup="LoginUserValidationGroup" />
                <div class="accountInfo">
                    <fieldset class="login">
                        <legend>Informations de compte</legend>
                        <p>
                            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Nom d'utilisateur :</asp:Label>
                            <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                CssClass="failureNotification" ErrorMessage="Un nom d'utilisateur est requis."
                                ToolTip="Un nom d'utilisateur est requis." ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
                        </p>
                        <p>
                            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Mot de passe :</asp:Label>
                            <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                CssClass="failureNotification" ErrorMessage="Un mot de passe est requis." ToolTip="Un mot de passe est requis."
                                ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
                        </p>
                        <p>
                            <asp:CheckBox ID="RememberMe" runat="server" />
                            <asp:Label ID="RememberMeLabel" runat="server" AssociatedControlID="RememberMe" CssClass="inline">Maintenir la connexion</asp:Label>
                        </p>
                    </fieldset>
                    <p class="submitButton">
                        <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Se connecter"
                            ValidationGroup="LoginUserValidationGroup" OnClick="Authentifier_Click" />
                    </p>
                </div>
            </LayoutTemplate>
        </asp:Login>
        <p>
            Salut
            <%
                // Si la variable de session user est non nulle,
                // on "écrit" sa valeur dans la page HTML que l'on génère
                if (Session["user"] != null)
                {
                    Response.Write(Session["user"]);
                }
                else
                {
                    Response.Write("inconnu");
                } %>
        </p>
        <p>
            Nom :
            <asp:TextBox ID="UserTextBox" runat="server" />
            <asp:Button ID="UserBouton" runat="server" OnClick="Authentifier_Click" Text="Ok" />
        </p>
    </div>
    </form>
</body>
</html>
